package cn.wolfcode.luowowo.common.util;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class AjaxResult implements Serializable{
    private boolean success;
    private String msg;
    private Object data;
    private int code;//约定102是没有登录状态码

    public AjaxResult(){
        this.success = true;
    }

    public AjaxResult(boolean success,String msg){
        this.success = success;
        this.msg = msg;
    }

    //成功
    public static AjaxResult SUCCESS(){
        return new AjaxResult();
    }

    public AjaxResult addData(Object data){
        this.data = data;
        return this;
    }
}
